Imports Iesi.Collections.Generic

Namespace Entities

    Public Class Candidate
        Implements IDomainEntity

        Protected Sub New()

        End Sub

        Public Sub New(ByVal id As Guid, ByVal name As String, ByVal dni As Integer, _
                       ByVal email As String, ByVal address As String)

            Dim cachedDateTime As DateTime = DateTime.Now

            Me.Id = id
            Me.Name = name
            Me.Dni = dni
            Me.Email = email
            Me.Address = address
            Me.CreatedDate = cachedDateTime
            Me.LastModified = cachedDateTime

        End Sub

        Public Sub New(ByVal name As String, ByVal dni As Integer, _
                       ByVal email As String, ByVal address As String)

            Me.New(Guid.NewGuid(), name, dni, email, address)

        End Sub

        Private _id As Guid
        Public Overridable Property Id() As System.Guid Implements IDomainEntity.Id
            Get
                Return _id
            End Get
            Set(ByVal value As System.Guid)
                _id = value
            End Set
        End Property

        Private _name As String
        Public Overridable Property Name() As String
            Get
                Return _name
            End Get
            Set(ByVal value As String)
                _name = value
            End Set
        End Property

        Private _dni As Integer
        Public Overridable Property Dni() As Integer
            Get
                Return _dni
            End Get
            Set(ByVal value As Integer)
                _dni = value
            End Set
        End Property

        Private _email As String
        Public Overridable Property Email() As String
            Get
                Return _email
            End Get
            Set(ByVal value As String)
                _email = value
            End Set
        End Property

        Private _address As String
        Public Overridable Property Address() As String
            Get
                Return _address
            End Get
            Set(ByVal value As String)
                _address = value
            End Set
        End Property

        Private _referring As User
        Public Overridable Property Referring() As User
            Get
                Return _referring
            End Get
            Set(ByVal value As User)
                _referring = value
            End Set
        End Property

        Private _isPromoted As Boolean
        Public Overridable Property IsPromoted() As Boolean
            Get
                Return _isPromoted
            End Get
            Set(ByVal value As Boolean)
                _isPromoted = value
            End Set
        End Property

        Private _searchRequests As ISet(Of SearchRequest) = New HashedSet(Of SearchRequest)
        Public Overridable Property SearchRequests() As ISet(Of SearchRequest)
            Get
                Return _searchRequests
            End Get
            Set(ByVal value As ISet(Of SearchRequest))
                _searchRequests = value
            End Set
        End Property

        Private _interviews As ISet(Of Interview) = New HashedSet(Of Interview)
        Public Overridable Property Interviews() As ISet(Of Interview)
            Get
                Return _interviews
            End Get
            Set(ByVal value As ISet(Of Interview))
                _interviews = value
            End Set
        End Property

        Private _createdDate As DateTime

        Public Overridable Property CreatedDate() As Date Implements IDomainEntity.CreatedDate
            Get
                Return _createdDate
            End Get
            Set(ByVal value As Date)
                _createdDate = value
            End Set
        End Property

        Private _lastModified As DateTime
        Public Overridable Property LastModified() As Date Implements IDomainEntity.LastModified
            Get
                Return _lastModified
            End Get
            Set(ByVal value As Date)
                _lastModified = value
            End Set
        End Property

        Private _isDeleted As Boolean
        Public Overridable Property IsDeleted() As Boolean Implements IDomainEntity.IsDeleted
            Get
                Return _isDeleted
            End Get
            Set(ByVal value As Boolean)
                _isDeleted = value
            End Set
        End Property

        Public Overridable Sub Validate() Implements IValidableEntity.Validate

        End Sub

        Public Overridable Sub ValidateDelete() Implements IValidableEntity.ValidateDelete

        End Sub

    End Class

End Namespace
